package com.imeem.api.results;

import java.util.ArrayList;

import com.imeem.api.data.MediaData;

public class SearchResults<T extends MediaData>
{
   private ArrayList<T> _results;
   private int _totalCount;
   
   public SearchResults()
   {
      // by default, imeem's apis only return 20 at a time
      _results = new ArrayList<T>(20);
      _totalCount = 0;
   }
   
   public T[] getResults()
   {
      return (T[]) _results.toArray(new MediaData[_results.size()]);
   }
   
   public void addItemToResult(T item)
   {
      _results.add(item);
   }
   
   public void clearResults()
   {
      _results.clear();
   }
   
   public int getTotalCount() { return _totalCount; }
   public void setTotalCount(int count) { _totalCount = count; }
}
